home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / SPAWNO41.ARJ / SPAWNO.INC < prev    next >
Text File  |  1991-11-05  |  2KB  |  82 lines

  1. ;-----------------------------------
  2. ; (c) Copyright 1991 Ralf Brown  All Rights Reserved
  3. ;
  4. ;  SPAWNVO
  5. ;    Overlaying spawnv()
  6. ;
  7. ;  File: SPAWNO.INC
  8. ;-----------------------------------
  9.  
  10. ;-----------------------------------------------------------
  11. ; describe a dummy structure to hold all the swap device-specific
  12. ; routines
  13.  
  14. _spawn_funcs struc
  15.  ?sf_init    dw ?    ; called to determine whether to swap to a given device
  16.  ?sf_write    dw ?    ; called to write out memory
  17.  ?sf_swapdone    dw ?    ; called when all memory written out
  18.  ?sf_swapin    dw ?    ; called when ready to read back memory
  19.  ?sf_read    dw ?    ; called to read back a section of memory
  20.  ?sf_finish    dw ?    ; called to clean up at very end of swap
  21.  ?sf_codeaddr    dw ?    ; address of code to append to resident stub
  22.  ?sf_codesize    dw ?    ; total size of code to be appended
  23.  ?sf_resident    dw ?    ; number of bytes which must stay resident
  24. _spawn_funcs ends
  25.  
  26. ;-----------------------------------------------------------
  27. ; define manifest constants
  28.  
  29. StackSize equ 160h            ; 352 bytes
  30. StackSizePara equ (StackSize+15)/16
  31. DefStackPara equ 4            ; default stack size (in para)
  32. MinStackPara equ 2            ; absolute minimum stack while spawned
  33.  
  34. ENOENT equ 2                ; file not found
  35. ENOPATH equ 3                ; path not found
  36. EMFILE equ 4                ; too many open files
  37. EACCESS equ 5                ; access denied
  38. EBADF equ 6                ; invalid file handle
  39. ECONTR equ 7                ; memory control blocks destroyed
  40. ENOMEM equ 8                ; out of memory
  41. EINVDAT equ 13                ; invalid data
  42. ENODEV equ 15                ; invalid drive / device
  43. EINVAL equ 19                ; invalid argument
  44. E2BIG equ 20                ; environment too big
  45. EWRITEFAULT equ 29            ; write error
  46.  
  47. ;-----------------------------------------------------------
  48. ; define constants needed by swapin code which can't be made
  49. ; into ABS externals
  50. ;
  51. abort_offset equ 26
  52. overlay_size equ 3Eh
  53. finish_overlay_size equ 5
  54. resident_addr equ 70h
  55.  
  56. ;-----------------------------------------------------------
  57. ; define useful macros
  58.  
  59. ifdef __TINY__
  60.     MOV_ES_PSP macro
  61.         push    cs
  62.         pop        es
  63.     endm
  64. else
  65.     MOV_ES_PSP macro
  66.          mov    es,_psp@
  67.      endm
  68. endif ;__TINY__
  69.  
  70. COALESCE_MEMORY macro
  71.     mov    ah,48h
  72.     mov    bx,0FFFFh        ; force DOS to coalesce free blocks
  73.     int    21h            ; by attempting to allocate 1MB-16
  74.     endm
  75.  
  76. ;-----------------------------------------------------------
  77.  
  78.  
  79. ;*************
  80. ;*END OF FILE*
  81. ;*************
  82.